/**
 * Copyright 2018 orivil.com. All rights reserved.
 * Use of this source code is governed by a MIT-style
 * license that can be found at https://mit-license.org.
 */

package main

import (
	"gitee.com/tugoer/orivil/mux"
	"gitee.com/tugoer/orivil/bundles/swagger"
	"gitee.com/tugoer/orivil/bundles/admin"
	"gitee.com/tugoer/wechat-share/code/actions"
	"gitee.com/tugoer/orivil/bundles/image"
	"gitee.com/tugoer/orivil/bundles/ip"
	"gitee.com/tugoer/orivil/session"
)

func main() {
	mux.HandleStatic("public", "")
	mux.AddActions(actions.Html...)
	mux.AddActions(swagger.Actions...)
	mux.AddActions(admin.Actions...)
	mux.AddActions(actions.Article...)
	mux.AddActions(actions.WeChat...)
	mux.AddActions(image.Actions...)
	mux.AddActions(actions.Index...)
	mux.AddActions(actions.Redirect...)
	mux.AddActions(actions.Domains...)
	mux.AddActions(actions.Channel...)
	mux.AddActions(ip.Actions...)
	var err error
	mux.Handler.SessionClient, err = session.NewClient(":7002")
	if err != nil {
		panic(err)
	}
	mux.Run()
}
